﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MsgMgr.aspx.cs" Inherits="MessageBoard_MsgMgr" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>留言板管理</title>

    <script type="text/javascript">
    function dispdiv(divid)
    {
         var div = document.getElementById(divid);   
         if(div.style.display =="inline")
         {
             div.style.display="none";
         }
         else
         {
            div.style.display="inline";
         }
     }  
   
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div class="tablecontent">
        <div class="centertop" id="dvNav" runat="server">
            当前位置：<a href="../Default.aspx">中共重庆市沙坪坝区委统一战线工作部</a>&nbsp;>>&nbsp;<a href="BgArticleList.aspx">留言板管理</a></div>
        <div class="tabletitle">
        </div>
        <div>
            共<asp:Label ID="lbl_Count" Text="0" runat="server"></asp:Label>条留言&nbsp;&nbsp;
        </div>
        <div>
            <asp:GridView ID="gv_MsgList" runat="server" AllowSorting="true" 
                AllowPaging="True" AutoGenerateColumns="False"
                EmptyDataText="没有留言信息" DataKeyNames="ID" PageSize="5" Width="850px" 
                OnPageIndexChanging="gv_MsgList_PageIndexChanging" 
                onsorting="gv_MsgList_Sorting">
                <Columns>
                    <asp:BoundField DataField="ID" HeaderText="留言ID" ReadOnly="True" Visible="false"/>
                    <asp:TemplateField ItemStyle-Width="50px" HeaderText="编号">
                        <ItemTemplate>
                            <%#Container.DataItemIndex + 1%>
                        </ItemTemplate>
                        <ItemStyle Width="50px"></ItemStyle>
                    </asp:TemplateField>
                    <asp:BoundField ItemStyle-Width="128px" DataField="UserName" HeaderText="用户名称" ReadOnly="True">
                        <ItemStyle Width="128px"></ItemStyle>
                    </asp:BoundField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            留言内容
                        </HeaderTemplate>
                        <ItemTemplate>
                            <div onclick="dispdiv('<%#Container.DataItemIndex + 1%>')">
                                <%#spbtzb.Common.CutString(spbtzb.AuthenCtr.Decode(Eval("Content").ToString()), 18)%></div>
                            <div id="<%#Container.DataItemIndex + 1%>" style="display: none; background-color:Gray;">
                                <%#spbtzb.AuthenCtr.Decode(Eval("Content").ToString())%>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField ItemStyle-Width="80px" DataField="IP" HeaderText="IP" ReadOnly="True">
                        <ItemStyle Width="80px"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField ItemStyle-Width="158px" DataField="CreateTime" HeaderText="留言时间"
                        ReadOnly="True" SortExpression="CreateTime">
                        <ItemStyle Width="158px"></ItemStyle>
                    </asp:BoundField>
                               <asp:TemplateField HeaderText="审核" Visible="false">
                                    <ItemTemplate>
                                         <asp:CheckBox ID="cb_AuditingTemp" runat="server" Enabled="false" Checked='<%#Eval("Status")%>'
                                Width="22px" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="50px" HeaderText="审核" SortExpression="Status">
                     
                        <ItemTemplate>
                            <asp:CheckBox ID="cb_Auditing" runat="server" Enabled="true" Checked='<%#Eval("Status")%>'
                                Width="22px" />
                        </ItemTemplate>
                        <ItemStyle Width="50px"></ItemStyle>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="50px">
                        <HeaderTemplate>
                            删除
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Button ID="btn_Del" runat="server" CommandArgument="DelCmda" CausesValidation="false"
                                Text="删除" OnClientClick="javascript: return confirm('您真的要删除这篇留言吗?');" OnClick="btn_Del_Click" />
                        </ItemTemplate>
                        <ItemStyle Width="50px"></ItemStyle>
                    </asp:TemplateField>
                
                </Columns>
                <PagerSettings FirstPageText="首页" LastPageText="末页" Mode="NextPreviousFirstLast"
                    NextPageText="下页" PreviousPageText="上页" />
            </asp:GridView>
        </div>
        <div class="buttonlist">
            <asp:Button ID="btn_Auditing" runat="server" CssClass="button" Text="审核通过" OnClick="btn_Auditing_Click" />
        </div>
    </div>
    </form>
</body>
</html>
